package com.day0907;

import java.util.Scanner;

public class Text4_task {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("请输入你的会员卡号：");
        int num = in.nextInt();
        System.out.println("你的会员卡号为：" + num);
        int numQ = num / 1000;
        int numB = num % 1000 / 100;
        int numS = num % 1000 % 100 / 10;
        int numG = num % 1000 % 100 % 10;
        System.out.println("千位数：" + numQ + ",百位数：" + numB + ",十位数：" + numS + "，个位数：" + numG);
        int sum = numQ + numB + numS + numG;
        System.out.println("会员卡号" + num + "各位数之和为:" + sum);
        String result = sum > 20 ? "会员卡号" + num + "的会员，恭喜你中奖了，奖品是Mp3" : "会员卡号" + num + "的会员，你没有中奖！";
        System.out.println(result);
    }
}
